namespace CthulhuDomain.GameEntities
{
  public class PlayerFactory : DomainFactory
  {
    public override DomainEntity CreateEntity(IContentManager manager)
    {
      return CreateEntity(manager, new PlayerState
                                     {
                                       LifePoints = 3,
                                       StartingPosition = new Vector2Adapter(0, 0)
                                     });
    }

    public override DomainEntity CreateEntity(IContentManager manager, EntityState state)
    {
      var entity = new Player(state.StartingPosition) { LifePoint = state.LifePoints, Texture = manager.LoadTexture("ship2") };
      entity.MovementStrategy = new Strategies.UserMovement(entity);
      entity.ProtoTypeChild = GetFactory(eTypeEntity.Shoot).CreateEntity(manager);
      entity.ProtoTypeChild.Texture = manager.LoadTexture("triangle");
      entity.ProtoTypeChild.Width = 22;
      entity.ProtoTypeChild.Height = 22;
      return entity;
    }
  }
}